<template>
  <DetailDescTable ref="DetailDescTable" :title="$tt('label_container_detail')"  :tableOption="detailTable" :descOption="detailDesc"
                   :url="detailUrl" :urlDataHandle="detailUrlDataHandle"/>
</template>

<script>
import DetailDescTable from "../detail_common.vue";

export default {
  name: "detail_container",
  components: {DetailDescTable},
  data() {
    return {
      detailUrl: '/wms-api/base/WmsBaseContainerRpc/detail.json',
      detailUrlDataHandle: (res) => {
        let {compartmentList, ...descData} = res.data
        return {
          descData, tableData: compartmentList,
        }
      },
      detailDesc: {
        model: [
          {key: 'code', label: 'label_container_code'},
          {key: 'status', label: 'label_status', formatter: (r, c, v) => this.$enumShow(v, "BaseContainerStatusEnum")},
          {key: 'containerTypeCode', label: 'label_container_type_code',},
          {key: 'warehouseCode', label: 'label_warehouse_code',},
          {key: 'areaCode', label: 'label_warehouse_area_code'},
          {key: 'locationCode', label: 'label_warehouse_location_code'},
          {key: 'compartmentNum', label: 'label_grid_mouth_count',},
          {key: 'containerRow', label: 'label_container_Layout_row_count',},
          {key: 'containerColumn', label: 'label_container_Layout_col_count',},
          {key: 'creator', label: 'label_create_user',},
          {key: 'gmtCreate', label: 'label_create_time', formatter: (r, c, v, i) => this.$dateFormat(v)},

        ],
      },
      detailTable: {
        model: [
          {key: 'code', label: 'label_grid_mouth_code', 'min-width': 140, 'show-overflow-tooltip': true,},
          {key: 'rowIndex', label: 'label_container_Layout_row', 'min-width': 120, 'show-overflow-tooltip': true,},
          {key: "columnIndex", label: "label_container_Layout_col", 'min-width': 120, 'show-overflow-tooltip': true,},
        ],
      },

    }
  },
  methods: {
    show({title, ...obj}) {
      this.$refs['DetailDescTable'].show(obj)

    },

    hide() {
      this.$refs['DetailDescTable'].hide()
    },

  }
}
</script>

<style scoped>

</style>
